<template>
  <div>
    <div class="banner" @click="handleClickShow">
      <img class="banner-img" :src="bannerImg" />
      <div class="banner-info">
        <div class="banner-title">{{this.sightName}}</div>
        <div>
          <span class="iconfont">&#xe7b3;</span>
          <span>{{this.gallaryImgs.length}}</span>
        </div>
      </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="gallaryImgs" v-show="showGallary" @close="handleGallary"></common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from '@/common/gallary/Gallary'
import FadeAnimation from '@/common/fade/FadeAnimation'
export default{
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGallary: false,
      imgs: ['http://img1.qunarzz.com/sight/p0/1804/bf/bf5aa0437db78bba3.img.jpg_350x240_41894fe2.jpg',
        'http://img1.qunarzz.com/sight/p0/1804/ce/ce0fdd9b4fc1e8ca3.img.jpg_350x240_b614d1f3.jpg']
    }
  },
  methods: {
    handleClickShow () {
      this.showGallary = true
    },
    handleGallary () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position relative
    overflow hidden
    height 0
    padding-bottom 54%
    .banner-img
      width 100%
    .banner-info
      display flex
      position absolute
      left 0
      right 0
      bottom 0
      padding .24rem
      font-size .34rem
      color #fff
      background: linear-gradient(to bottom,rgba(0,0,0,0),rgba(0,0,0,0.7));
      .banner-title
        flex 1
</style>
